package xyz.sunting.tos.passthrough.demo;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.tencent.tws.api.PassThroughManager;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        findViewById(R.id.send).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.d("MainActivity", "begin send data...");
                PassThroughManager.getInstance(getApplicationContext()).sendData("Test message data",
                        getApplicationContext().getPackageName(), new PassThroughManager.PassThroughSendDataResultListener() {
                            @Override
                            public void onReceiveSendDataResult(int resultCode) {
                                Log.d("MainActivity", "onReceiveSendDataResult resultCode = " + resultCode);
                            }
                        });
            }
        });
    }
}
